<template>
  <VPage>
    <el-tabs v-model="type" class="w-full h-10 px-3">
      <el-tab-pane v-for="d in tabs" :key="d.name" :label="d.label" :name="d.name" />
    </el-tabs>
    <div v-for="d in tabs" :key="d.name" v-show="d.name === type" style="height: calc(100% - 40px);">
      <Intelligent :type="d.name" :sale="sale" />
    </div>
  </VPage>
</template>

<script setup>
import apiFn from './api'
import Intelligent from './components/Intelligent'

const props = defineProps({
  sale: Boolean,
})

provide('api', apiFn(props.sale ? 'list-intelligent-stock' : 'intelligent-stock'))

const type = ref(1)
const tabs = ref([
  { label: '国家维度', name: 1 },
  { label: '仓库维度', name: 2 },
  { label: '运营人员维度', name: 3 },
])
</script>
